import  { baseUrl, service } from './axios'

const api = {
  baseUrl: baseUrl,
  login: (param) => {
    return service({
      url: '/api/login',
      method: 'post',
      data: param,
    })
  },
  getCode: (param) => {
    return service({
      url: '/api/getCode',
      method: 'post',
      data: param,
    })
  },
  register: (param) => {
    return service({
      url: '/api/register',
      method: 'post',
      data: param,
    })
  },
  updatePassword: (param) => {
    return service({
      url: '/api/updatePassword',
      method: 'post',
      data: param,
    })
  },
  articleRank: (param) => {
    return service({
      url: '/api/user/statistics/articleRank',
      method: 'post',
      data: param,
    })
  },
  getAllNotice: (param) => {
    return service({
      url: '/api/user/notice/getAllNotice',
      method: 'post',
      data: param,
    })
  },
  allWordCloud: (param) => {
    return service({
      url: '/api/user/statistics/allWordCloud',
      method: 'post',
      data: param,
    })
  },
  getArticleByCategory: (param) => {
    return service({
      url: '/api/user/article/getArticleByCategory',
      method: 'post',
      data: param,
    })
  },
  getArticlesByTag: (param) => {
    return service({
      url: '/api/user/article/getArticlesByTag',
      method: 'post',
      data: param,
    })
  },
  getArticlesByTitle: (param) => {
    return service({
      url: '/api/user/article/getArticlesByTitle',
      method: 'post',
      data: param,
    })
  },
  getAllTag: (param) => {
    return service({
      url: '/api/user/tag/getAllTag',
      method: 'post',
      data: param,
    })
  },
  getAllCollections: (param) => {
    return service({
      url: '/api/user/collection/getAllCollections',
      method: 'post',
      data: param,
    })
  },
  getArticleByUserId: (param) => {
    return service({
      url: '/api/user/article/getArticleByUserId',
      method: 'post',
      data: param,
    })
  },
  publishArticle: (param) => {
    return service({
      url: '/api/user/article/publishArticle',
      method: 'post',
      data: param,
    })
  },
  deleteArticle: (param) => {
    return service({
      url: '/api/admin/article/deleteArticle',
      method: 'post',
      data: param,
    })
  },
  updateArticle: (param) => {
    return service({
      url: '/api/user/article/updateArticle',
      method: 'post',
      data: param,
    })
  },
  getArticleById: (param) => {
    return service({
      url: '/api/user/article/getArticleById',
      method: 'post',
      data: param,
    })
  },
  collectArticle: (param) => {
    return service({
      url: '/api/user/article/collectArticle',
      method: 'post',
      data: param,
    })
  },
  cancelCollection: (param) => {
    return service({
      url: '/api/user/article/cancelCollection',
      method: 'post',
      data: param,
    })
  },
  scoreArticle: (param) => {
    return service({
      url: '/api/user/article/scoreArticle',
      method: 'post',
      data: param,
    })
  },
  articleViewCountGraph: (param) => {
    return service({
      url: '/api/user/statistics/articleViewCountGraph',
      method: 'post',
      data: param,
    })
  },
  articleCategoryNum: (param) => {
    return service({
      url: '/api/user/statistics/articleCategoryNum',
      method: 'post',
      data: param,
    })
  },
  categoryCollectionNum: (param) => {
    return service({
      url: '/api/user/statistics/categoryCollectionNum',
      method: 'post',
      data: param,
    })
  },
  wordCloud: (param) => {
    return service({
      url: '/api/user/statistics/wordCloud',
      method: 'post',
      data: param,
    })
  },
  updateUser: (param) => {
    return service({
      url: '/api/user/user/updateUser',
      method: 'post',
      data: param,
    })
  },
  getAllUsers: (param) => {
    return service({
      url: '/api/admin/user/getAllUsers',
      method: 'post',
      data: param,
    })
  },
  deleteUser: (param) => {
    return service({
      url: '/api/admin/user/deleteUser',
      method: 'post',
      data: param,
    })
  },
  updateUserRole: (param) => {
    return service({
      url: '/api/admin/user/updateUserRole',
      method: 'post',
      data: param,
    })
  },
  manageArticles: (param) => {
    return service({
      url: '/api/admin/article/manageArticles',
      method: 'post',
      data: param,
    })
  },
  aDeleteArticle: (param) => {
    return service({
      url: '/api/admin/article/deleteArticle',
      method: 'post',
      data: param,
    })
  },
  passArticle: (param) => {
    return service({
      url: '/api/admin/article/passArticle',
      method: 'post',
      data: param,
    })
  },
  aGetAllNotice: (param) => {
    return service({
      url: '/api/admin/notice/getAllNotice',
      method: 'post',
      data: param,
    })
  },
  deleteNotice: (param) => {
    return service({
      url: '/api/admin/notice/deleteNotice',
      method: 'post',
      data: param,
    })
  },
  publishNotice: (param) => {
    return service({
      url: '/api/admin/notice/publishNotice',
      method: 'post',
      data: param,
    })
  },
  updateNotice: (param) => {
    return service({
      url: '/api/admin/notice/updateNotice',
      method: 'post',
      data: param,
    })
  },
  publishMessage: (param) => {
    return service({
      url: '/api/user/message/publishMessage',
      method: 'post',
      data: param,
    })
  },
  getAllMessages: (param) => {
    return service({
      url: '/api/user/message/getAllMessages',
      method: 'post',
      data: param,
    })
  },
  getUserInfo: (param) => {
    return service({
      url: '/api/user/user/getUserInfo',
      method: 'post',
      data: param,
    })
  },
  aGetAllMessages: (param) => {
    return service({
      url: '/api/admin/message/getAllMessages',
      method: 'post',
      data: param,
    })
  },
  answerMessage: (param) => {
    return service({
      url: '/api/admin/message/answerMessage',
      method: 'post',
      data: param,
    })
  },
  aArticleCategoryNum: (param) => {
    return service({
      url: '/api/admin/statistics/articleCategoryNum',
      method: 'post',
      data: param,
    })
  },
  aCategoryCollectionNum: (param) => {
    return service({
      url: '/api/admin/statistics/categoryCollectionNum',
      method: 'post',
      data: param,
    })
  },
  userCountGraph: (param) => {
    return service({
      url: '/api/admin/statistics/userCountGraph',
      method: 'post',
      data: param,
    })
  },
}

export default api

// export default {
  // getAdminHome: (param) => {
  //   return axios.request({
  //     url: '/admin/home/home',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // timeline: (param) => {
  //   return axios.request({
  //     url: '/admin/user/timeline',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // currentRegisterStatus: (param) => {
  //   return axios.request({
  //     url: '/admin/systemStatus/currentRegisterStatus',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // changeRegisterSwitch: (param) => {
  //   return axios.request({
  //     url: '/admin/systemStatus/changeRegisterSwitch',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // slogList: (param) => {
  //   return axios.request({
  //     url: '/admin/slog/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // slogInf: (param) => {
  //   return axios.request({
  //     url: '/admin/slog/info',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // slogReview: (param) => {
  //   return axios.request({
  //     url: '/admin/slog/review',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // slogUpdate: (param) => {
  //   return axios.request({
  //     url: '/admin/slog/update',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // slogDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/slog/delete',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleList: (param) => {
  //   return axios.request({
  //     url: '/admin/article/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleInf: (param) => {
  //   return axios.request({
  //     url: '/admin/article/info',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleTop: (param) => {
  //   return axios.request({
  //     url: '/admin/article/top',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleAdd: (param) => {
  //   return axios.request({
  //     url: '/admin/article/add',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleUpdate: (param) => {
  //   return axios.request({
  //     url: '/admin/article/update',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // articleDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/article/delete',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // userList: (param) => {
  //   return axios.request({
  //     url: '/admin/user/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // userInf: (param) => {
  //   return axios.request({
  //     url: '/admin/user/info',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // userAdd: (param) => {
  //   return axios.request({
  //     url: '/admin/user/add',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // userUpdate: (param) => {
  //   return axios.request({
  //     url: '/admin/user/update',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // userDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/user/delete',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // commentList: (param) => {
  //   return axios.request({
  //     url: '/admin/comment/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // commentDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/comment/delete',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemList: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/delete',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemInfo: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/info',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemUpdate: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/update',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemSeeable: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/seeable',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // problemAdd: (param) => {
  //   return axios.request({
  //     url: '/admin/problem/add',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamList: (param) => {
  //   return axios.request({
  //     url: '/admin/team/list',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamUserList: (param) => {
  //   return axios.request({
  //     url: '/admin/team/userList',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamDeluser: (param) => {
  //   return axios.request({
  //     url: '/admin/team/deluser',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamAdduser: (param) => {
  //   return axios.request({
  //     url: '/admin/team/addUser',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamAdd: (param) => {
  //   return axios.request({
  //     url: '/admin/team/add',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamUpdate: (param) => {
  //   return axios.request({
  //     url: '/admin/team/update',
  //     method: 'post',
  //     data: param
  //   })
  // },
  // teamDelete: (param) => {
  //   return axios.request({
  //     url: '/admin/team/delete',
  //     method: 'post',
  //     data: param
  //   })
  // }
// }
